package org.soenea.doitall.domain.model.group;

import java.util.List;

import org.dsrg.soenea.domain.DomainObjectCreationException;
import org.dsrg.soenea.domain.MapperException;
import org.dsrg.soenea.domain.proxy.DomainObjectProxy;
import org.soenea.doitall.domain.model.group.mapper.GroupInputMapper;
import org.soenea.doitall.domain.model.invite.IInvite;

public class GroupProxy extends DomainObjectProxy<Long, Group> implements
		IGroup {

	public GroupProxy(Long id) {
		super(id);
	}

	@Override
	public String getGroupName() {
		return getInnerObject().getGroupName();
	}

	@Override
	public void setGroupName(String groupName) {
		getInnerObject().setGroupName(groupName);
	}

	@Override
	public List<IInvite> getMembers() {
		return getInnerObject().getMembers();
	}

	@Override
	public void setMembers(List<IInvite> members) {
		getInnerObject().setMembers(members);
	}

	@Override
	protected Group getFromMapper(Long id) throws MapperException,
			DomainObjectCreationException {
		try{
			return GroupInputMapper.find(id);
		}catch (Exception e) {
			throw new DomainObjectCreationException(e.getMessage(),e);
		}
	}

	@Override
	public String getDescription() {
		return getInnerObject().getDescription();
	}

	@Override
	public void setDescription(String description) {
		getInnerObject().setDescription(description);
	}



}
